import request from '@/utils/request'
import { centerPrefix } from '../apiConifg'
const qs = require('qs')

// 获取验证码相关接口
/**
 * 获取系统字典列表-(不支持分页参数)
 * @param params
 */
export function getVerifyImage(params) {
  return request({
    url: centerPrefix + '/open/code/image?' + qs.stringify(params, { indices: false }),
    method: 'get',
    responseType: 'blob'
  })
}

export const verifyImageURL = process.env.VUE_APP_BASE_API + centerPrefix + '/open/code/image?deviceId='

export const getVerifyImageURL = function() {
  return process.env.VUE_APP_BASE_API + centerPrefix + '/open/code/image?v=' + new Date().getTime() + '&deviceId='
}

export default { getVerifyImage, verifyImageURL, getVerifyImageURL }
